package bbalgae.swing.outline;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.UIManager;
import javax.swing.border.EmptyBorder;

import ch.randelshofer.quaqua.QuaquaManager;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JRadioButton;
import javax.swing.JSlider;
import javax.swing.JScrollBar;
import javax.swing.JTextPane;
//스윙 프로그램의 모양과 느낌변경
//javax.swing.UIManager클래스의 setLookAndFeel 메소드 사용
// com.sun.java.swing.plaf.gtk.GTKLookAndFeel
//javax.swing.plaf.metal.MetalLookAndFeel
// com.sun.java.swing.plaf.windows.WindowLookAndFeel
// com.sun.java.swing.plaf.motif.MotifLookAndFeel
// com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel

//JFrame.setDefaultLookAndFeelDecorated(true);
//UIManager.setLookAndFeel( 룩앤필명칭);

// MacOSX와 비슷한 LookAndFeel을 제공하는 사이트가 있음 (www.randelshofer.ch/quaqua
public class J06_HelloSwingLookAndFeel extends JFrame {

	private JPanel contentPane;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		//System.setProperty("Quaqua.tabLayoutPolicy","wrap");
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					JFrame.setDefaultLookAndFeelDecorated(true);
					//quaqua 룩앤필 적용
					
					UIManager.setLookAndFeel(QuaquaManager.getLookAndFeel());
					
					J06_HelloSwingLookAndFeel frame = new J06_HelloSwingLookAndFeel();
				
					//UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");
					//LookAndFeel지정 		
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public J06_HelloSwingLookAndFeel() {
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 450, 300);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		contentPane.setLayout(new BorderLayout(0, 0));
		setContentPane(contentPane);
		
		JButton btnNewButton = new JButton("New button");
		contentPane.add(btnNewButton, BorderLayout.NORTH);
		
		JCheckBox chckbxNewCheckBox = new JCheckBox("New check box");
		contentPane.add(chckbxNewCheckBox, BorderLayout.WEST);
		
		JRadioButton rdbtnNewRadioButton = new JRadioButton("New radio button");
		contentPane.add(rdbtnNewRadioButton, BorderLayout.EAST);
		
		JSlider slider = new JSlider();
		contentPane.add(slider, BorderLayout.CENTER);
		
		JTextPane textPane = new JTextPane();
		contentPane.add(textPane, BorderLayout.SOUTH);
	}

}
